package org.hbnu.xiaomi.service;

import org.hbnu.xiaomi.entity.Goods;
import org.hbnu.xiaomi.mapper.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class GoodsService implements GoodsMapper {
    //注明需要一个查询接口
    @Autowired
    GoodsMapper goodsMapper;

    @Override
    public Goods getById(int id) {
        return goodsMapper.getById(id);
    }

    @Override
    public List<Goods> getByTypesId(int types_id) {
        return goodsMapper.getByTypesId(types_id);
    }

    @Override
    public List<Goods> getAll() {
        return goodsMapper.getAll();
    }

    @Override
    public void update(Goods goods) {
        goodsMapper.update(goods);
    }

    @Override
    public void deleteById(int id) {
        goodsMapper.deleteById(id);
    }
}
